# @Author  : BoPo
# @Time    : 2021/9/9 15:51
# @Function:
import pandas as pd


class Response(object):
    _data: object

    def __init__(self, data):
        self._data = data

    def to_df(self):

        if isinstance(self._data, list):
            return pd.DataFrame(data=self._data)

        if isinstance(self._data, dict):
            return pd.DataFrame(data=[self._data, ])

        return pd.DataFrame(data=[{'value': self._data}])

    def to_adj(self, factry=''):
        return pd.DataFrame(self._data)


if __name__ == '__main__':
    ret = Response(['ad', 'sdf'])
    ret.to_df()
